<template>
	<view>

	</view>
</template>

<script>
	import {
		request,
		requestData
	} from '@/utils/http.js'
	export default {
		data() {
			return {
				phone: ''
			}
		},
		onLoad(option) {},
		onShow() {
			this.initSiteInfo()
		},
		methods: {
			initSiteInfo() {
				request('/common/site/info', {
						site_code: '17001',
						with_images: 1,
					})
					.then((res) => {
						this.phone = res.datas.phone
						this.callPhoneNumber()
					})
					.catch((err) => {
						console.log(err)
					})
			},
			callPhoneNumber() {
				uni.makePhoneCall({
					phoneNumber: this.phone,
					success: () => {
						console.log('拨打成功')
					},
					fail: () => {
						console.error('拨打失败')
					},
				})
			}


		}
	}
</script>

<style>

</style>